﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;
using Microsoft.EntityFrameworkCore.Design;

namespace EfConsole.Migrations
{
    public class TestContextFactory : IDesignTimeDbContextFactory<TestContext>
    {
        public TestContext CreateDbContext(string[] args)
        {
            var cb = new SqlConnectionStringBuilder
            {
                DataSource = "192.168.3.30",
                InitialCatalog = "cop-test-back",
                UserID = "sa",
                Password = "1qaz2wsxE"
            };

            return new TestContext(cb.ConnectionString);
        }
    }
}
